package hpu.bitenergy.servlet;

import hpu.bitenergy.Factory.Factory;
import hpu.bitenergy.IFactory.IFactory;
import hpu.bitenergy.List.GetList;
import hpu.bitenergy.util.QueryHelper;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mongodb.DBObject;

//推荐专家信息
public class indexservlet extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		IFactory fa=Factory.GetIFactory("E");
		GetList li=fa.GetListInstance();
		List<DBObject> list=li.getQueryListLimit(QueryHelper.gettuijianE());
		response.setContentType("text/plain");
		response.setCharacterEncoding("UTF-8");
		if(list!=null)
		{
			request.setAttribute("list", list);
		}
		request.getRequestDispatcher("/index.jsp").forward(request, response);
//		
//		PrintWriter out=response.getWriter();
//		out.print(list.toString());
//		out.flush();
//		out.close();
		
		
	}

}
